<template>
  <div id="goback">
    <el-page-header @back="goBack" :content="content"></el-page-header>
  </div>
</template>
<script setup lang="ts">
import { getCurrentInstance } from 'vue';
let { proxy }: any = getCurrentInstance();
let props = defineProps<{
  content: string;
  backUrl?: string;
}>();
function goBack(): void {
  if (props.backUrl) {
    proxy.$router.push(props.backUrl);
  } else {
    proxy.$router.go(-1); //返回上一层
  }
  proxy.$emit('closeDrawer')
}
</script>
<style lang="scss">
#goback {
  height: 40px;
  .el-page-header {
    z-index: 3;
    padding: 8px 15px;
    border-left: $border-3;
    box-shadow: $bottom-shadow;
    background-color: $bg-white;
    // top: 40px;
    width: 100%;
    position: fixed;
    line-height: 20px;

    .el-page-header__content {
      font-size: $font-size;
    }
  }
}
</style>